package com.jk.dmuserprovider.service;

import com.jk.dmcommon.entity.OrderEntity;
import com.jk.dmcommon.entity.TicketEntity;
import com.jk.dmuserprovider.dao.OrderDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


/**
 * @描述
 * @参数 $
 * @返回值 $
 * @创建人 lgf
 * @创建时间 $
 * @修改人和其它信息
 */
@Service
public class OrderService {
    @Autowired
    private MongoTemplate mongoTemplate;
    @Resource
    private OrderDao orderDao;

    public Object findOrder(String orderId) {
        OrderEntity order = new OrderEntity();
        Query query = new Query();
        query.addCriteria(Criteria.where("orderId").is(orderId));
        OrderEntity one = mongoTemplate.findOne(query, OrderEntity.class);
        return  one;
    }

    public TicketEntity findcouponId(Integer couponId) {
        return orderDao.findcouponId(couponId);
    }
}
